import Vue from 'vue'
import './plugins/axios'
import App from './App.vue'
import router from './router'
import "@/assets/maincss/main.css"
// import _ from "lodash"

Vue.config.productionTip = false

Vue.filter('TimesetMS', function (value) {
  if (!value) return '';

  return `${String(Math.floor(value / 60)).padStart(2, "0")}:${String((value % 60).toFixed(0)).padStart(2, "0")}`

}),

  Vue.filter("timesss", function (value) {

    if (!value) return '';
    const date = new Date(value);
    const day = date.getDate().toString().padStart(2, '0'); // 确保日是两位数
    const month = (date.getMonth() + 1).toString().padStart(2, '0'); // 月份从0开始，所以加1

    return `${month}月${day}日`;
  });

Vue.filter('formatNumber', function (value) {
  if (!value) return '';

  let num = parseFloat(value);
  if (isNaN(num)) return '';

  let units = ['千', '万', '亿'];
  let unitIndex = 0;

  // 循环直到数值小于10
  while (num >= 10000 && unitIndex < units.length - 1) {
    num /= 10000;
    unitIndex++;
  }

  // 保留两位小数
  return num.toFixed(2) + units[unitIndex];
});

const style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = `
html::-webkit-scrollbar {
  width: 0; 
  height: 0;
   scrollbar-width: none;
}

  body::-webkit-scrollbar {
  width: 0; 
  height: 0; 
   scrollbar-width: none;
}
`;
document.head.appendChild(style);

new Vue({
  router,
  // _,
  render: h => h(App)

}).$mount('#app')
